package ktjy.mapper.user;

import ktjy.pojo.StorageRecord;
import ktjy.pojo.vo.StorageRecordVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface StorageRecordMapper {
    /**
     * 查询入库记录表
     *
     * @return
     */
    public List<StorageRecord> getStorageRecordList(StorageRecord storageRecord);

    public List<StorageRecord> getList(StorageRecord storageRecord);

    public List<StorageRecord> findRuKu();

    List<StorageRecordVO> getPageList(@Param("goodsName") String goodsName, @Param("supplierId")Integer supplierId, @Param("payStatus") Integer payStatus, @Param("pageIndex") Integer pageIndex, @Param("pageSize") Integer pageSize);

    Long getCount(@Param("goodsName")String goodsName,@Param("supplierId")Integer supplierId,@Param("payStatus")Integer payStatus);

    StorageRecordVO getStorageRecordById(Integer id);

    /**
     * 新增入库记录
     */
    @Insert("INSERT INTO storage_record(goods_name,supplier_id,goods_num,goods_price,pay_status,create_time,update_time) VALUES(#{goodsName},#{supplierId},#{goodsNum},#{goodsPrice},#{payStatus},#{createTime},#{updateTime})")
    void insertStorageRecord(StorageRecord storageRecord);

    /**
     * 修改入库单
     */
    void updateStorageRecord(StorageRecord storageRecord);

    /**
     * 删除入库单
     */
    void deleteStorageRecord(Integer id);
}